import datetime
import os
import sys

from selenium import webdriver
class Driver:
    options = webdriver.ChromeOptions()
    driver = webdriver.Chrome('C:\\Program Files\\Google\\Chrome\\chromedriver-win64\\chromedriver.exe', options=options)
    def GetScreenShot(selfs):
        dirname = datetime.datetime.now().strftime('%Y-%m-%d')
        if not os.path.exists('../images/' + dirname):
            os.mkdir('../images/' + dirname)

        filename = sys._getframe().f_back.f_code.co_name + "-" + datetime.datetime.now().strftime('%Y-%m-%d-%H%M%S') + ".png"
        selfs.driver.save_screenshot(f'../images/{dirname}/' + filename)
BlogDirver = Driver()
